package com.lineage.server.timecontroller.server;

import com.lineage.server.thread.GeneralThreadPool;
import java.util.TimerTask;
import java.util.concurrent.ScheduledFuture;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ServerResetMapTimer extends TimerTask {
  private static final Log _log = LogFactory.getLog(ServerResetMapTimer.class);
  
  private ScheduledFuture<?> _timer;
  
  public void start() {
    int timeMillis = 300000;
    this._timer = GeneralThreadPool.get().scheduleAtFixedRate(this, 300000L, 300000L);
  }
  
  public void run() {
    try {
      System.out.println("检查重置限时地监时间轴执行");
    } catch (Exception e) {
      _log.error("检查重置限时地监时间轴异常重启", e);
      GeneralThreadPool.get().cancel(this._timer, false);
      ServerResetMapTimer resetMapTimer = new ServerResetMapTimer();
      resetMapTimer.start();
    } 
  }
}
